package api

import (
	"gateway/basic/config"
	__ "gateway/basic/proto"
	"gateway/handler/request"
	"github.com/gin-gonic/gin"
	"net/http"
)

func ClassCreate(c *gin.Context) {

}

func OrderCreate(c *gin.Context) {

}

func OrderDetail(c *gin.Context) {
	var req request.OrderDetail
	if err := c.ShouldBind(&req); err != nil {
		c.JSON(http.StatusOK, gin.H{
			"code": 400,
			"msg":  "参数接收失败",
			"data": err.Error(),
		})
		return
	}
	order, err := config.ClassClient.OrderData(c, &__.OrderDataReq{
		Id: req.Id,
	})
	if err != nil {
		c.JSON(http.StatusOK, gin.H{
			"code": 400,
			"msg":  "订单信息查询失败",
			"data": err.Error(),
		})
		return
	}
	c.JSON(http.StatusOK, gin.H{
		"code": http.StatusOK,
		"msg":  "订单信息查询成功",
		"data": order,
	})
}
